/// Created by Harley on 2023/6/1.
import 'package:flutter/cupertino.dart';

import '../theme/gt_theme_provider.dart';

Alignment get GTAlignmentCenterLeft {
  return GTThemeProvider.instance.isRTL() ? Alignment.centerRight : Alignment.centerLeft;
}

Alignment get GTAlignmentCenterRight {
  return GTThemeProvider.instance.isRTL() ? Alignment.centerLeft : Alignment.centerRight;
}

Alignment get GTAlignmentTopLeft {
  return GTThemeProvider.instance.isRTL() ? Alignment.topRight : Alignment.topLeft;
}

Alignment get GTAlignmentTopRight {
  return GTThemeProvider.instance.isRTL() ? Alignment.topLeft : Alignment.topRight;
}

Alignment get GTAlignmentBottomLeft {
  return GTThemeProvider.instance.isRTL() ? Alignment.bottomRight : Alignment.bottomLeft;
}

Alignment get GTAlignmentBottomRight {
  return GTThemeProvider.instance.isRTL() ? Alignment.bottomLeft : Alignment.bottomRight;
}

EdgeInsets GTEdgeInsetsOnly({
  double left = 0.0,
  double top = 0.0,
  double right = 0.0,
  double bottom = 0.0,
}) {
  return GTThemeProvider.instance.isRTL()
      ? EdgeInsets.only(left: right, top: top, right: left, bottom: bottom)
      : EdgeInsets.only(left: left, top: top, right: right, bottom: bottom);
}

EdgeInsets GTEdgeInsetsFormRTLB(double left, double top, double right, double bottom) {
  return GTThemeProvider.instance.isRTL() ? EdgeInsets.fromLTRB(right, top, left, bottom) : EdgeInsets.fromLTRB(left, top, right, bottom);
}

Rect GTRectFormRTLB(double left, double top, double right, double bottom) {
  return GTThemeProvider.instance.isRTL() ? Rect.fromLTRB(right, top, left, bottom) : Rect.fromLTRB(left, top, right, bottom);
}
